package com.fy.commodity.api;

import com.fy.commodity.basedto.PageSize;
import com.fy.commodity.reqdto.*;
import com.fy.commodity.resdto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PatchMapping;

import java.util.List;

/**
 * @author Administrator
 */
@FeignClient(value = "domain-commodity", path = "commodity")
public interface CommodityService {

    //----------------发布商品接口-------------------//

    //商品待审核列表
    @PatchMapping(value = "queryauditlist")
    List<CommodityListDto> queryAuditList(PageSize pageSize);

    //商品待审核详情
    @PatchMapping(value = "queryauditdetails")
    CommodityDetailsDto queryAuditDetails(Integer commodityId, Integer shopId);

    //更改审核状态
    @PatchMapping(value = "ispass")
    Integer isPass(IsPassDto isPassDto);

    //-------------------商品接口-----------------//
    //商品列表
    @PatchMapping(value = "querycommoditylist")
    List<CommodityShowDto> queryCommodityList();

    @PatchMapping(value = "querycommoditylist")
    List<CommodityShowDto> queryCommodityList(Integer shopId);

    //创建商品
    @PatchMapping(value = "createcommodity")
    Integer createCommodity(CommodityCreateDto commodityCreateDto);

    //更新商品
    @PatchMapping(value = "updatecommodity")
    Integer updateCommodity(CommodityUpdateDto commodityUpdateDto);

    //删除商品
    @PatchMapping(value = "deletecommodity")
    Integer deleteCommodity(Integer shopId, Integer commodityId);

    //------------------类别接口----------------//

    //类别列表
    @PatchMapping(value = "querycategorylist")
    List<CategoryDto> queryCategoryList();


    //创建类别
    @PatchMapping(value = "createcategory")
    Integer createCategory(CategoryCreateDto categoryCreateDto);

    //更新类别
    @PatchMapping(value = "updatecategory")
    Integer updateCategory(CategoryUpdateDto categoryUpdateDto);

    //删除类别
    @PatchMapping(value = "deletecategory")
    Integer deleteCategory(Integer categoryId);

    //------------------规格接口----------------//
    //规格列表
    @PatchMapping(value = "querySpecification")
    List<SpecificationDto> querySpecification(Integer categoryId);

    //创建规格
    @PatchMapping(value = "createspecification")
    Integer createSpecification(SpecificationCreateDto specificationCreateDto);

    //更新规格
    @PatchMapping(value = "updatespecification")
    Integer updateSpecification(SpecificationUpdateDto specificationUpdateDto);

    //删除规格
    @PatchMapping(value = "deletespecification")
    Integer deleteSpecification(Integer categoryId, Integer specificationId);
}
